<!-- include tpl=head_lay -->
<form method="post" id="post_save" class="layui-form" onsubmit="return $.admin_user.save()">
<!-- if $id --><input type="hidden" name="id" id="id" value="{$id}" /><!-- /if -->
<div class="layui-card">
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang用户组}
			</label>
			<div class="layui-input-inline default-auto">
				<select id="group_id" name="group_id"  lay-filter="usergroup">
				<option value="0">{lang请选择用户组…}</option>
				<!-- loop from=$grouplist key=$key value=$value -->
				<option value="{$value.id}"{if $value.id == $group_id} selected{/if} data-fields="{$value.fields}">{$value.title}</option>
				<!-- /loop -->
				</select>
			</div>
			<div class="layui-input-inline auto gray lh38">{lang请选择用户所属主要身份}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang用户账号}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="user" name="user" class="layui-input" value="{$rs.user}" />
			</div>
			<div class="layui-input-inline auto gray lh38">
				<input type="button" value="{lang随机生成}" onclick="$('#user').val($.phpok.rand(6,'letter'))" class="layui-btn layui-btn-sm" />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang请填写用户账号，必须保证唯一，建议使用邮箱作为账号}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang用户密码}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="pass" name="pass" class="layui-input" value="" />
			</div>
			<div class="layui-input-inline auto gray lh38">
				<input type="button" value="{lang随机生成}" onclick="$('#pass').val($.phpok.rand(10,'fixed'))" class="layui-btn layui-btn-sm" />
			</div>
			<div class="layui-form-mid">
				{lang设置用户的密码，此项不能为空}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{langEmail}
			</label>
			<div class="layui-input-block">
				<input type="text" id="email" name="email" class="layui-input" value="{$rs.email}" />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang手机}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="mobile" name="mobile" class="layui-input" value="{$rs.mobile}" />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang如有手机号，请填写}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang用户头像}
			</label>
			<div class="layui-input-block">
				{func form_edit avatar $rs.avatar text form_btn=image&width=500}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang状态}
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" name="status" id="status_0" value="0"{if !$rs.status} checked{/if} title="{lang未审核}" />
				<input type="radio" name="status" id="status_1" value="1"{if $rs.status == 1} checked{/if} title="{lang正常}" />
				<input type="radio" name="status" id="status_2" value="2"{if $rs.status == 2} checked{/if} title="{lang锁定}" />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang设置用户状态，未审核及锁定用户不能登录}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang注册时间}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="regtime" name="regtime" class="layui-input"{if $rs.regtime} value="{func date 'Y-m-d H:i:s' $rs.regtime}"{/if} />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang人工设置用户的注册时间，默认使用当前时间}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang邀请码}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="code" name="code" class="layui-input" value="{$rs.code}" />
			</div>
			<div class="layui-input-inline auto gray lh38">
				<input type="button" value="{lang随机生成}" onclick="$('#code').val($.phpok.rand(3,'letter')+$.phpok.rand(5,'fixed'))" class="layui-btn layui-btn-sm" />
			</div>
			<div class="layui-form-mid">
				{lang用于邀请用户注册的识别码，字母+数字组成}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang推荐人}
			</label>
			<div class="layui-input-inline auto">
				{func form_edit relation_id $relation_id user}
			</div>
			<div class="layui-input-inline auto gray lh38">{lang无推荐人请留空}</div>
		</div>
		<!-- loop from=$extlist key=$key value=$value id=extlist_id -->
		<div class="layui-form-item" id="userext_{$value.identifier}" name="userext_html">
			<label class="layui-form-label">
				{$value.title}
			</label>
			<!-- if $value.note --><div class="layui-input-block gray" style="line-height:38px;">{$value.note}</div><!-- /if -->
			<div class="layui-input-block">
				{$value.html}
			</div>
		</div>		
		<!-- /loop -->	
	</div>
</div>
<!-- plugin userform -->
<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang提交}" class="layui-btn layui-btn-lg layui-btn-danger" />
		<input type="button" value="{lang取消关闭}" class="layui-btn layui-btn-lg layui-btn-primary" onclick="$.admin.close()" />
	</div>
</div>

</form>
<!-- include tpl=foot_lay -->